首页

欢迎

 

Welcome

欢迎, 这是一个学习数学、讨论数学的网站.

转到问题

请输入问题号, 例如: 2512

IMAGINE, THINK, and DO
How to be a scientist, mathematician and an engineer, all in one?
--- S. Muthu Muthukrishnan

Local Notes

Local Notes 是一款 Windows 下的笔记系统.

Local Notes 下载

Sowya

Sowya 是一款运行于 Windows 下的计算软件.

详情

下载 Sowya.7z (包含最新版的 Sowya.exe and SowyaApp.exe)


注: 自 v0.550 开始, Calculator 更名为 Sowya. [Sowya] 是吴语中数学的发音, 可在 cn.bing.com/translator 中输入 Sowya, 听其英语发音或法语发音.





注册

欢迎注册, 您的参与将会促进数学交流. 注册

在注册之前, 或许您想先试用一下. 测试帐号: usertest 密码: usertest. 请不要更改密码.


我制作的 slides

Problem

随机显示问题

Problèmes d'affichage aléatoires

软件 >> ARIBAS
Questions in category: ARIBAS (aribas).

将整数作因子分解

Posted by haifeng on 2016-01-12 17:17:34 last update 2024-05-13 09:11:27 | Answers (0)


==> x:=1023;

while q:=factor16(x) do
    writeln(q);
    x:=x div q;
end;
x.


Then the ARIBAS will display the divisors of x:


3
11
-: 31


 

需要注意的是, factor16(x) 这个函数返回 x 的小于 min(2**16,x) 的最小素因子, 如果这样的素因子存在的话. 如果不存在小于 min(2**16,x) 的素因子, 则返回 0. 因此这里的 while 循环会一直运行到 x 是素数为止或在 2**16 以下没有找到素因子则终止.

 


Sowya 中使用 factorise(n) 将 n 作因子分解

>> factorise(1023)
out> 3*11*31

------------------------